package com.jwm.power.controller;

import com.jwm.power.model.reponse.ResponseData;
import com.jwm.power.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;

//  Excel操作
@Controller
@RequestMapping("/excels")
public class ExcelController {
    @Autowired
    private ExcelService excelService;
    //  导入
    @RequestMapping(params = "excelImport")
    @ResponseBody
    public ResponseData ExcelImport(HttpServletRequest request, HttpServletResponse response) throws ParseException {
        return  excelService.ExcelImport(request);
    }
    //  导出
    @RequestMapping(params = "excelExport")
    @ResponseBody
    public ResponseData ExcelExport(HttpServletRequest request, HttpServletResponse response) throws Exception {
        return  excelService.ExcelExport(request,response);
    }
}
